<template>
	<view class="container">
		<view class="titleBox">
			<view class="text">
				1 RM：以正确的技术所能举起一次最大重量。<br />
				<view style="
            font-size: 10px;
            width: 70%;
            text-align: center;
            margin: 0 auto;
            margin-top: 10rpx;
          ">
					这里可以根据您的训练目的和动作为您选择最适合的1
					RM百分比作为您的本次训练最佳负荷。
				</view>
			</view>
			<view class="icon">
				<image src="../../static/imgs/j1.png" mode=""></image>
			</view>
		</view>
		<view class="historyBtn" @click="goHistory">
			<view class="text"> 历史数据 </view>

			<image src="../../static/imgs/history.png" mode=""></image>
		</view>
		<view class="btnBox">
			<view class="btnItem" @click="goTest(2)">
				<image class="imgT" src="../../static/imgs/crown.png" mode=""></image>
				<text class="tipText"> 会员特权 </text>
				<image class="imgJ2" src="../../static/imgs/j2.png" mode=""></image>
				<view style="line-height: 158rpx">
					复杂测试，最精准
					<!-- 	<view class="text">
						本次1RM值较精准，在测量当天训练中可以使用，但最精确值需隔数日后再次在此模式测量后得到最终结果，方可用于后续训练。
					</view> -->
				</view>
			</view>

			<view class="btnItem" @click="goTest(1)">
				<image class="imgT" src="../../static/imgs/crown.png" mode=""></image>
				<view class="tipText"> 会员特权 </view>
				<image class="imgJ2" src="../../static/imgs/j3.png" mode=""></image>
				<view style="line-height: 158rpx"> 简单测试，大众适用 </view>
			</view>
			<view style="line-height: 158rpx" class="btnItem" @click="goTest(0)">
				不测试，估算结果
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {},
			};
		},
		onLoad(option) {
			// const item = JSON.parse(decodeURIComponent(option.item));
			// console.log(item, '传递参数');
		},
		onShow() {
			let userInfo = uni.getStorageSync("userInfo");
			this.userInfo = userInfo;
			const isLoggedIn = uni.getStorageSync('hashLogin');
			if (!isLoggedIn) {
				// 未登录，跳转到登录页
				// console.log("未登录，跳转登录页");
				// uni.navigateTo({
				// 	url: '/pages/loginA/loginA', // 登录页面路径
				// });
			}
		},
		methods: {
			// e:0不测试，1简单测试，2复杂测试
			goTest(e) {
				if (e == 0) {
					uni.navigateTo({
						url: "/pagesTool/jobComplexTestCommon/jobComplexTestCommon",
					});
				} else if (e == 1) {
					// uni.navigateTo({
					// 	url: '/pagesTool/jobComplexTest2/jobComplexTest2'
					// })
					if (this.userInfo.isMember || true) {
						uni.navigateTo({
							url: "/pagesTool/jobComplexTest2/jobComplexTest2",
						});
					} else {
						uni.showToast({
							title: "请充值会员解锁特权",
							icon: "none",
						});
					}
				} else if (e == 2) {
					// uni.navigateTo({
					// 	url: '/pagesTool/jobComplexTest/jobComplexTest'
					// })
					if (this.userInfo.isMember || true) {
						uni.navigateTo({
							url: "/pagesTool/jobComplexTest/jobComplexTest",
						});
					} else {
						uni.showToast({
							title: "请充值会员解锁特权",
							icon: "none",
						});
					}
				}
			},
			goHistory() {
				uni.navigateTo({
					url: "/pagesTool/historyRm/historyRm",
				});
			},
		},
	};
</script>
<style>
	page {
		margin: 0;
		padding: 0;
		height: 100%;
		width: 100%;
	}

	// 去掉页面滚动条
	::-webkit-scrollbar {
		display: none !important;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
	}
</style>
<style lang="less" scoped>
	.container {
		height: 100%;
		width: 100%;
		font-family: PingFangSC-Semibold, PingFang SC;
		padding: 30rpx;
		box-sizing: border-box;
		overflow-y: scroll !important;
		background: #f6f6f6;
		color: #333;
		padding-bottom: 50rpx;
		box-sizing: border-box;
		background-color: rgba(110, 88, 170, 0.02);

		.titleBox {
			width: 90%;
			margin: 0 auto;
			padding: 35rpx;
			border-radius: 3px;
			background: rgba(121, 72, 234, 0.21);
			// filter: blur(4px);
			position: relative;
			margin-bottom: 100rpx;
			margin-top: 50rpx;

			// background: linear-gradient(90deg, rgba(121, 72, 234, 0.5) 0%, #ddced8 100%);
			background-color: #f2f2f3;
			box-shadow: 0px 2px 4px rgba(110, 88, 170, 0.2);

			.text {
				opacity: 1;
				font-size: 14px;
				font-weight: 400;
				font-family: "优设标题黑";
				color: #6e58aa;
			}

			.icon {
				position: absolute;
				right: 0%;
				bottom: 0%;

				image {
					width: 80rpx;
					height: 80rpx;
				}
			}
		}

		.historyBtn {
			width: 82px;
			height: 23px;
			border-radius: 2px;
			background: rgba(255, 255, 255, 1);
			// border: 1px solid rgba(121, 72, 234, 1);
			display: flex;
			align-items: center;
			justify-content: center;
			float: right;
			margin-top: -25px;
			margin-right: 60rpx;
			font-size: 12px;

			.text {
				text-align: center;
				font-size: 12px;
				font-family: "优设标题黑";
				color: rgba(110, 88, 170, 1);
			}

			image {
				width: 10px;
				height: 10px;
				margin-left: 3px;
			}
		}

		.btnBox {
			margin-top: 150rpx;
			font-family: "优设标题黑";

			.btnItem {
				width: 536rpx;
				height: 158rpx;
				border-radius: 4px;
				background: #6e58aa;
				// border: 2rpx solid rgba(121, 72, 234, 1);
				margin: 0 auto;
				margin-top: 98rpx;
				position: relative;
				font-size: 36rpx;
				font-weight: 400;
				color: #fff;
				// line-height: 158rpx;
				text-align: center;

				.text {
					font-size: 9px;
					font-weight: 400;
					letter-spacing: 0px;
					line-height: 13.03px;
					color: rgba(227, 60, 100, 0.89);
					text-align: center;
				}

				.imgT {
					position: absolute;
					width: 82px;
					height: 74px;
					left: 0;
				}

				.imgJ2 {
					position: absolute;
					width: 49px;
					height: 35px;
					right: 0%;
					bottom: 0%;
				}

				.tipText {
					font-size: 26rpx;
					font-weight: 900;
					color: rgba(227, 59, 157, 1);
					font-weight: 900;
					position: absolute;
					left: 2px;
					top: 2px;

					background: linear-gradient(to bottom, #e1ddee, #9b8dc5);
					background-clip: text;
					-webkit-background-clip: text;
					-webkit-text-fill-color: transparent;
				}
			}
		}
	}
</style>